home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / samba / INSTALL.txt < prev    next >
Text File  |  1995-04-24  |  13KB  |  337 lines

  1. HOW TO INSTALL AND TEST SAMBA
  2. =============================
  3.  
  4.  
  5. STEP 0. Read the man pages. They contain lots of useful info that will
  6. help to get you started. If you don't know how to read man pages then
  7. try something like:
  8.  
  9.     nroff -man smbd.8 | more
  10.  
  11. STEP 1. install a smb client. 
  12.  
  13. There are several, eg: Pathworks, Lanmanager for DOS, Windows for
  14. Workgroups, Windows95, Lanmanager for Windows, Lanmanager for OS/2,
  15. Windows NT come to mind. Lanmanager for dos is available via ftp from
  16. ftp.microsoft.com in bussys/MSclient/dos/. Please read the licensing
  17. stuff before downloading. Use the TCP/IP option in the client. Add
  18. your server to the \etc\lmhosts (or equivalent) file on the client.
  19.  
  20. Note that your client must support TCP/IP. All the clients that I know
  21. of do, but with many TCP/IP is not installed by default. With some you
  22. have to get an optional add-on to support TCP/IP. The add-ons for
  23. windows for workgroups, dos and OS/2 are available via anonymous ftp
  24. from ftp.microsoft.com.
  25.  
  26. The TCP/IP package for WfWg is available from ftp.microsoft.com as the file
  27. /peropsys/windows/public/tcpip/wfwt32.exe
  28.  
  29.  
  30. STEP 2. Install Samba on a unix box. 
  31.  
  32. To do this, first edit the Makefile. You will find that the Makefile
  33. has an entry for most unixes and you need to uncomment the one that
  34. matches your operating system. 
  35.  
  36. You should also edit the section at the top of the Makefile which
  37. determines where things will be installed. You need to get this right
  38. before compilation as Samba needs to find some things at runtime
  39. (smbrun in particular). There are also settings for where you want
  40. your log files etc. Make sure you get these right, and that the
  41. directories exist.
  42.  
  43. Then type "make". This will create smbd, nmbd and smbclient.
  44.  
  45. Once it's successfully compiled you can use "make install" to install
  46. the binaries and manual pages. You can separately install the binaries
  47. and/or man pages using "make installbin" and "make installman".
  48.  
  49. Note that if you are upgrading for a previous version of Samba you
  50. might like to know that the old versions of the binaries will be
  51. renamed with a ".old" extension. You can go back to the previous
  52. version with "make revert" if you find this version a disaster!
  53.  
  54.  
  55. STEP 3. Create the smb configuration file. 
  56.  
  57. There is a sample configuration file called smb.conf.sampl supplied
  58. with the distribution. It has lots of comments on some of the
  59. available options. See the man page for all the options.
  60.  
  61. The simplest useful configuration file would be something like this:
  62.  
  63. [homes]
  64.     guest ok = no
  65.     read only = no
  66.  
  67. which would allow connections by anyone with an account on the server,
  68. using either their login name or "homes" as the service name.
  69.  
  70. Note that "make install" will not install a smb.conf file. You need to
  71. create it yourself. You will also need to create the path you specify
  72. in the Makefile for the logs etc, such as /usr/local/samba.
  73.  
  74. Make sure you put the smb.conf file in the same place you specified in
  75. the Makefile.
  76.  
  77. STEP 4. Test your config file with testparm
  78.  
  79. It's important that you test the validity of your smb.conf file using
  80. the testparm program. If testparm runs OK then it will list the loaded
  81. services. If not it will give an error message.
  82.  
  83. STEP 5. Starting the smbd and nmbd. 
  84.  
  85. You must choose to start smbd and nmbd either as daemons or from
  86. inetd. Don't try to do both!  Either you can put them in inetd.conf
  87. and have them started on demand by inetd, or you can start them as
  88. daemons either from the command line or in /etc/rc.local. See the man
  89. pages for details on the command line options.
  90.  
  91. The man advantage of starting smbd and nmbd as a daemon is that they
  92. will respond slightly more quickly to an initial connection
  93. request. This is, however, unlilkely to be a problem.
  94.  
  95. Step 5a. Starting from inetd.conf
  96.  
  97. Look at your /etc/services. What is defined at port 139/tcp. If
  98. nothing is defined then add a line like this:
  99.  
  100. netbios-ssn     139/tcp
  101.  
  102. similarly for 137/udp you should have an entry like:
  103.  
  104. netbios-ns    137/udp
  105.  
  106. Next edit your /etc/inetd.conf and add two lines something like this:
  107.  
  108. netbios-ssn stream tcp nowait root /usr/local/samba/smbd smbd 
  109. netbios-ns dgram udp wait root /usr/local/samba/nmbd nmbd 
  110.  
  111. The exact syntax of /etc/inetd.conf varies between unixes. Look at the
  112. other entries in inetd.conf for a guide.
  113.  
  114. NOTE: Some unixes already have entries like netbios_ns (note the
  115. underscore) in /etc/services. You must either edit /etc/services or
  116. /etc/inetd.conf to make them consistant.
  117.  
  118. NOTE: On many systems you may need to give the nmbd a -B parameter to
  119. specify the broadcast address of your interface. Run ifconfig as root
  120. if you don't know what the broadcast is for your net. nmbd tries to
  121. determine it at run time, but fails on some unixes. See the section on
  122. "testing nmbd" for a method of finding if you need to do this.
  123.  
  124. !!!WARNING!!! Many unixes only accept around 5 parameters on the
  125. command line in inetd. This means you shouldn't use spaces between the
  126. options and arguments, or you should use a script, and start the
  127. script from inetd.
  128.  
  129. Restart inetd, perhaps just send it a HUP. If you have installed an
  130. earlier version of nmbd then you may need to kill nmbd as well.
  131.  
  132. Step 5b. Alternative: starting it as a daemon
  133.  
  134. To start the server as a daemon you should create a script something
  135. like this one, perhaps calling it "startsmb"
  136.  
  137. #!/bin/sh
  138. /usr/local/samba/smbd -D 
  139. /usr/local/samba/nmbd -D 
  140.  
  141. then make it executable with "chmod +x startsmb"
  142.  
  143. You can then run startsmb by hand or execute it from /etc/rc.local
  144.  
  145. To kill it send a kill signal to the processes nmbd and smbd.
  146.  
  147.  
  148.  
  149. STEP 7. Try listing the shares available on your server
  150.  
  151. smbclient -L yourhostname
  152.  
  153. Your should get back a list of shares available on your server. If you
  154. don't then something is incorrectly setup. Note that this method can
  155. also be used to see what shares are available on other LanManager
  156. clients (such as WfWg).
  157.  
  158. If you chose user level security then you may find that Samba requests
  159. a password before it will list the shares. See the smbclient docs for
  160. details. 
  161.  
  162. STEP 8. try connecting with the unix client. eg:
  163.  
  164. smbclient '\\yourhostname\aservice'
  165.  
  166. Typically the "yourhostname" would be the name of the host where you
  167. installed smbd. The "aservice" is any service you have defined in the
  168. smb.conf file. Try your user name if you just have a [homes] section
  169. in smb.conf.
  170.  
  171. For example if your unix host is bambi and your login name is fred you
  172. would type:
  173.  
  174. smbclient '\\bambi\fred'
  175.  
  176. NOTE: The number of slashes to use depends on the type of shell you
  177. use. You may need "\\\\bambi\\fred" with some shells.
  178.  
  179. STEP 9. Try connecting from a dos/WfWg/Win95/NT/os-2 client. Try
  180. mounting disks. eg:
  181.  
  182. net use d: \\servername\service
  183.  
  184. Try printing. eg:
  185.  
  186. net use lpt1: \\servername\spoolservice
  187. print filename
  188.  
  189. Celebrate, or send me a bug report!
  190.  
  191. TESTING NMBD
  192. ============
  193.  
  194. As of version 1.7.00 it is possible to test nmbd to see if it is
  195. correctly installed. This can also test to see if it can auto-detect
  196. your broadcast address.
  197.  
  198. Under some operating systems you can only test the broadcast part if
  199. running as root. You can test other functionality from a non-root
  200. account. To test from root use:
  201.  
  202. nmbd -L TESTNAME
  203.  
  204. where TESTNAME is the netbios name you wish to test. This would
  205. typically be the hostname of the unix host where you installed nmbd.
  206. It should return the IP address of the host you are looking for. If it
  207. doesn't then something is wrong with your nmbd configuration. (It is
  208. also possibe that you have a net configuration that doesn't send
  209. broadcasts to itself. Some Linux configurations do this.)
  210.  
  211. If it fails then it could mean it is not correctly detecting your
  212. broadcast address or netmask. You will then need to supply the -B and
  213. -N parameters. See the nmbd man page for details.
  214.  
  215. It has succeeded if somewhere in the output is a line like:
  216.  
  217. ww.xx.yy.zz HOSTNAME
  218.  
  219. which means it managed to look the IP correctly.
  220.  
  221. To test from a non-root account use:
  222.  
  223. nmbd -B HOSTNAME -L TESTNAME
  224.  
  225. where hostname is the host name of the host where nmbd is installed
  226. and TESTNAME is the name you want to test. Typically this would be the
  227. same as HOSTNAME.
  228.  
  229.  
  230. NAME RESOLUTION
  231. ===============
  232.  
  233. Probably the most common problem people have when installing Samba is
  234. getting name resolution to work. This is usually caused by incorrect
  235. settings for nmbd.
  236.  
  237. One solution is to use nmbd as a WINS server, instead of using name
  238. resolution by broadcast. To do this you need to enter the IP address
  239. of the Samba server in the WINS section of your WfWg, Win95 or WinNT TCP/IP
  240. setup.
  241.  
  242. As a last resort you can use a lmhosts file on the PC to resolve names,
  243. as long as you enable lmhosts name resolution in the right dialog
  244. box. This doesn't lend itself very well to update, however.
  245.  
  246. The best solution is, however, to fix the nmbd setup. Experimentation
  247. and careful reading of the Samba docs should help.
  248.  
  249.  
  250. CHOOSING THE PROTOCOL LEVEL
  251. ===========================
  252.  
  253. The SMB protocol has many dialects. Currently Samba supports 4, called
  254. CORE, COREPLUS, LANMAN1, LANMAN2 and NT1.
  255.  
  256. You can choose what protocols to support in the smb.conf file. The
  257. default is NT1 and that is the best for the vast majority of sites.
  258.  
  259. In older versions of Samba you may have found it necessary to use
  260. COREPLUS. The limitations that led to this have mostly been fixed. It
  261. is now less likely that you will want to use less than LANMAN1. The
  262. only remaining advantage of COREPLUS is that for some obscure reason
  263. WfWg preserves the case of passwords in this protocol, whereas under
  264. LANMAN1, LANMAN2 or NT1 it uppercases all passwords before sending them,
  265. forcing you to use the "password level=" option in some cases.
  266.  
  267. The main advantage of LANMAN2 and NT1 is support for long filenames with some
  268. clients (eg: smbclient, Windows NT or Win95). 
  269.  
  270. See the smb.conf manual page for more details.
  271.  
  272. Note: To support print queue reporting you may find that you have to
  273. use TCP/IP as the default protocol under WfWg. For some reason if you
  274. leave Netbeui as the default it may break the print queue reporting on
  275. some systems. It is presumably a WfWg bug.
  276.  
  277.  
  278. PRINTING FROM UNIX
  279. ==================
  280.  
  281. To use a printer that is available via a smb-based server from a unix
  282. host you will need to compile the smbclient program. You then need to
  283. install the script "smbprint". Read the instruction in smbprint for
  284. more details.
  285.  
  286. There is also a SYSV style script that does much the same thing called
  287. smbprint.sysv. It contains instructions.
  288.  
  289.  
  290. LOCKING
  291. =======
  292.  
  293. One area which sometimes causes trouble is locking.
  294.  
  295. There are two types of locking which need to be performed by a SMB
  296. server. The first is "record locking" which allows a client to lock a
  297. range of bytes in a open file. The second is the "deny modes" that are
  298. specified when a file is open.
  299.  
  300. Samba supports "record locking" using the fcntl() unix system
  301. call. This is often implemented using rpc calls to a rpc.lockd process
  302. running on the system that owns the filesystem. Unfortunately many
  303. rpc.lockd implementations are very buggy, particularly when made to
  304. talk to versions from other vendors. It is not uncommon for the
  305. rpc.lockd to crash.
  306.  
  307. There is also a problem translating the 32 bit lock requests generated
  308. by PC clients to 31 bit requests supported by most
  309. unixes. Unfortunately many PC applications (typically OLE2
  310. applications) use byte ranges with the top bit set as semaphore
  311. sets. Samba attempts translation to support these types of
  312. applications, and the translation has proved to be quite successful.
  313.  
  314. Strictly a SMB server should check for locks before every read and
  315. write call on a file. Unfortunately with the way fcntl() works this
  316. can be slow and may overstress the rpc.lockd. It is also almost always
  317. unnecessary as clients are supposed to independently make locking
  318. calls before reads and writes anyway if locking is important to
  319. them. By default Samba only makes locking calls when explicitly asked
  320. to by a client, but if you set "strict locking = yes" then it will
  321. make lock checking calls on every read and write. 
  322.  
  323. You can also disable by range locking completely using "locking =
  324. no". This is useful for those shares that don't support locking or
  325. don't need it (such as cdroms). In this case Samba fakes the return
  326. codes of locking calls to tell clients that everything is OK.
  327.  
  328. The second class of locking is the "deny modes". These are set by an
  329. application when it opens a file to determine what types of access
  330. should be allowed simultaneously with it's open. A client may ask for
  331. DENY_NONE, DENY_READ, DENY_WRITE or DENY_ALL. There are also special
  332. compatability modes called DENY_FCB and DENY_DOS.
  333.  
  334. By default Samba does not implement these share modes. If you use
  335. "share modes = yes" then Samba will implement them using locking files
  336. in the "lock directory". See the man pages for details.
  337.